import math

# 浮点数计算
n1 = 3.1
n2 = 15.267
print(
    n1+n2
)

# 四舍五入
n3 = round(n1+n2, 2)
print(n3)
print("四舍五入 %.2f " % n3)

# 向上取整: 只要小数点后面有值就加一
n4 = math.ceil(n1+n2)
print(n4)
# 向下取整, 直接舍去小数点后面的东西
n5 = math.floor(n1+n2)
print("向下取整的结果%s" % n5)

